-- card: 30563 from stack: in.5 -- bmap block id: 7154 -- flags: 0000 -- background id: 3858 -- name: CDDriveList ----- HyperTalk script ----- on CloseCard put empty into cd fld "ids" put empty into cd fld "disk present" pass CloseCard end CloseCard on HideObjects hide cd fld "label" hide cd fld "disk present" hide cd fld "ids" hide cd btn "try it!" end HideObjects on ShowObjects show cd fld "label" show cd fld "disk present" show cd fld "ids" show cd btn "try it!" end ShowObjects -- part 1 (button) -- low flags: 00 -- high flags: A002 -- rect: left=70 top=283 right=317 bottom=163 -- title width / last selected line: 0 -- icon id / first selected line: 0 / 0 -- text alignment: 1 -- font id: 0 -- text size: 12 -- style flags: 8192 -- line height: 16 -- part name: Try It! ----- HyperTalk script ----- on mouseUp global errGlobal put empty into cd fld "disk present" put empty into cd fld "ids" put CDDriveList("noDialog:errGlobal") into CDdata if errGlobal ≠ empty then answer "Error: “" & errGlobal & "”" put empty into errGlobal else if CDData = empty then answer "No CD-ROM drives found." exit mouseUp end if repeat with driveNdx = 1 to the number of items in line 1 of CDData put (item driveNdx of line 1 of CDData) & return after cd fld "ids" put item driveNdx of line 2 of CDData & return after cd fld "disk present" end repeat end if end mouseUp -- part 2 (field) -- low flags: 00 -- high flags: 2002 -- rect: left=110 top=129 right=276 bottom=170 -- title width / last selected line: 0 -- icon id / first selected line: 0 / 0 -- text alignment: 0 -- font id: 4 -- text size: 12 -- style flags: 0 -- line height: 16 -- part name: disk present -- part 3 (field) -- low flags: 00 -- high flags: 2002 -- rect: left=56 top=129 right=276 bottom=111 -- title width / last selected line: 0 -- icon id / first selected line: 0 / 0 -- text alignment: 1 -- font id: 4 -- text size: 12 -- style flags: 0 -- line height: 16 -- part name: ids -- part 5 (field) -- low flags: 00 -- high flags: 0000 -- rect: left=51 top=102 right=129 bottom=185 -- title width / last selected line: 0 -- icon id / first selected line: 0 / 0 -- text alignment: 0 -- font id: 3 -- text size: 10 -- style flags: 256 -- line height: 13 -- part name: label -- part contents for background part 38 ----- text ----- 6/50 -- part contents for card part 5 ----- text ----- CD-ROM Disk SCSI ID Present? -- part contents for background part 20 ----- text ----- An XFCN which returns a list of the SCSI IDs of all attached CD-ROM drives, and the state of the drives (empty or full). The first line of the result is a comma delimited list of the SCSI IDs. The second line of the result is a comma delimited list, matching the ID list item for item, in which a "false" indicates an empty drive, and a "true" indicates a drive with a CD in it. For instance the result 3,4,6 true,false,true would indicate that three CD drives are attached (lucky soul!) at SCSI IDs 3, 4, and 6. The drives at IDs 3 and 6 have disks in them, while the drive at 4 is empty. Calling Syntax: CDDriveList(<"noDialog:"errorGlobal>